package cn.school.service;

import cn.school.dao.GradeDao;
import cn.school.entity.Grade;
import cn.school.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class GradeService {
    public List<Grade> findAll(){
        SqlSession ss = MyBatisUtil.get();
        try{
            GradeDao g = ss.getMapper(GradeDao.class);
            return g.findAll();
        }finally {
            MyBatisUtil.close(ss);
        }
    }
}
